import request from "@/utils/request";
export default {

  //获取已读通知列表
  getReadList(data) {
    return request({
      url: "/api/msg/user/read/",
      method: "get",
      params:data
    });
  },
  //未读通知和列表
  getUnreadList(data) {
    return request({
      url: "/api/msg/user/unread/",
      method: "get",
      params:data
    });
  },

  //未读消息数量
  getUnread_count(data) {
    return request({
      url: "/api/msg/user/unread_count/",
      method: "get",
      params:data
    });
  },
  //未读消息数量
  getUnread_count2(data) {
    return request({
      url: "/api/msg/count/",
      method: "get",
      params:data
    });
  },
  //所有通知和列表
  getNoticeList(data) {
    return request({
      url: "/api/msg/user/",
      method: "get",
      params:data
    });
  },
  //读取通知
  readMsg(id) {
    return request({
      url: "/api/msg/user/" + id + "/",
      method: "put"
    });
  },

  //删除通知
  toDelete(id) {
    return request({
      url: "/api/msg/user/" + id + "/",
      method: "delete"
    });
  },
  //获取消息详情
  getMsgDetail(id) {
    return request({
      url: "/api/msg/user/" + id + "/",
      method: "get"
    });
  },
  //发送公告
  toAdd(data) {
    return request({
      url: "/api/msg/",
      method: "post",
      data
    });
  },
  //设置全部消息为已读
  msgAllRead() {
    return request({
      url: "/api/msg/user/set_all_read/",
      method: "put"
    });
  },
  //清空
  getMsgDelete() {
    return request({
      url: "/api/msg/user/delete/",
      method: "put"
    });
  },
  //拿所有角色的数据
  getAccountsRolesNotice_user(data) {
    return request({
      url: "/api/accounts/roles/simple_roles/",
      method: "get",
      params:data
    });
  },
  //所有通知和列表
  getIpostList(data) {
    return request({
      url: "/api/msg/",
      method: "get",
      params:data
    });
  },

};
